package com.af.system.exception;

/**
 * @author : zhenyun.su
 * @since : 2019/9/7
 * @Comment: 自定义全局网络异常,用于http异常处理
 */

public class AfException extends Exception {
    private Integer code;
    private Object data;

    public AfException() {
        super();
    }

    public AfException(String message) {
        super(message);
    }

    public AfException(Integer code, String message) {
        super(message);
        this.code = code;
    }
    public AfException(Integer code, String message, Object data) {
        super(message);
        this.code = code;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "{code=" + code +
                ", msg=" + this.getMessage() +
                ", data=" + data +
                '}';
    }
}
